-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable special characters in UI5 control ids #159
Conversation
dominikfeininger
commented
Mar 2, 2022
- change wdio selector from id to xpath
- basic check for selector structure
id: 'Title::NoAction.h1', | ||
viewName: "test.Sample.view.Main" | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please apply prettier formatting on the file :)
expect(titleWwdio).toEqual('UI5 demo'); | ||
}); | ||
|
||
it.only('check for invalid control selector', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm .only
src/lib/wdi5-bridge.ts
Outdated
@@ -142,6 +142,20 @@ function _createWdioUI5KeyFromSelector(selector: wdi5Selector): string { | |||
|
|||
export async function addWdi5Commands() { | |||
browser.addCommand("_asControl", async (wdi5Selector: wdi5Selector) => { | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suggest to outsource this in a separate function.
- there will be more conditional checks in the future (e.g.
controlType
&&viewName
OR onlyid
) - we should be more specific with the error, e.g.
selector is missing the "selector" object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mini thingies still left, almost good to go!
src/lib/wdi5-bridge.ts
Outdated
@@ -12,6 +12,7 @@ import { clientSide__navTo } from "../../client-side-js/_navTo" | |||
|
|||
import { Logger as _Logger } from "./Logger" | |||
const Logger = _Logger.getInstance() | |||
// test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls remove
src/lib/wdi5-bridge.ts
Outdated
* @param wdi5ControlSelector | ||
* @returns {Boolean} if the givven selector is a valid selector | ||
*/ | ||
function _verifySelector(wdi5ControlSelector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the type here: wdi5ControlSelector: wdi5Selector
src/lib/wdi5-bridge.ts
Outdated
/** | ||
* does a basic validation of a wdi5ControlSelector | ||
* @param wdi5ControlSelector | ||
* @returns {Boolean} if the givven selector is a valid selector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "givven"
type "Boolean" -> "boolean"